<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2021/11/15
  Time: 11:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

<%
    ArrayList<String> people = new ArrayList<>();
    people.add("1");
    people.add("2");
    people.add("3");
    people.add("4");
    people.add("5");
    request.setAttribute("list",people);
%>

<%--var:每一遍历出来的对象  items要遍历的对象  begin:开始下标（含）  end:结束下标（含）  setp:步长   --%>

<c:forEach var="people" items="${list}">
    <c:out value="${people}"/>
    <br>
</c:forEach>

<c:forEach var="people" items="${list}" begin="1" end="3" step="2">

</c:forEach>


</body>
</html>
